import React from "react";
import Button from "./Button";
import MyContext from "../contexts/MyContext";

class Hello extends React.Component {
  render(): React.ReactNode {
    // Consumer 的 children 需要是一个 renderProp
    return (
      <MyContext.Consumer>
        {(value) => (
          <div>
            <p>Hello</p>
            <p>value: {value}</p>

            <Button />
          </div>
        )}
      </MyContext.Consumer>
    );
  }
}
export default Hello;
